package com.woniu.cq.medical.controller;


import com.woniu.cq.medical.common.Result;
import com.woniu.cq.medical.entity.CaseChangeInfo;
import com.woniu.cq.medical.service.CaseChangeInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2020-09-09
 */
@RestController
@RequestMapping("/medical/case-change-info")
@CrossOrigin("*")//解决跨域问题
@Slf4j
public class CaseChangeInfoController {

    @Autowired
    private CaseChangeInfoService caseChangeInfoService;

    /**
     * 根据身份证和病历号查询病人的病例修改记录   如果caseID为空的字符串  则只使用  idCard 作为条件查询
     * @param idCard
     * @return
     */
    @RequestMapping("selectCaseChangeInfoByIdCard")
    public Result selectCaseChangeInfoByIdCard(String idCard,String caseId){
        List<CaseChangeInfo> caseChangeInfos = caseChangeInfoService.selectCaseChangeInfoByIdCard(idCard,caseId);
        return Result.success(caseChangeInfos);
    }



}

